package com.tanhua.model.vo;



import com.tanhua.model.mongo.TestPaper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageVo {
    private String id;    //问卷id  例如1 2 3
    private String name;   //问卷名称
    private String cover;        //问卷封面
    private String level;           //问卷水平，初中高
    private Integer star;    //问卷星级，2-5  例如：2颗星，3颗星，5颗星
    private List<TestQuestionVo> questions; 		   //试题
    private Integer isLock = 1; //是否被锁，0解锁，1锁住

    private String reportId; //最新报告  报告的id 有的话就改成查看报告


    public static PageVo init(TestPaper testPaper, List<TestQuestionVo> testQuestionVos){

        PageVo pageVo = new PageVo();

        pageVo.setId(testPaper.getId().toString());
        pageVo.setName(testPaper.getName());
        pageVo.setCover(testPaper.getCover());
        pageVo.setLevel(testPaper.getLevel());
        pageVo.setStar(testPaper.getStar());
        pageVo.setQuestions(testQuestionVos);

        return pageVo;
    }


}
